import { localSet, localGet, localRemove } from '@/common/utils/GlobalUtils'

const state = {
  isRouterAlive: true,
  isLoading: false,
  tenderType: [] || localGet('tenderType'),
  deptList: [] || localGet('deptList')
}

const mutations = {
  set_isRouterAlive: (state, isRouterAlive) => {
    state.isRouterAlive = isRouterAlive;
  },
  set_isLoading: (state, isLoading) => {
    state.isLoading = isLoading;
  },
  set_tenderType: (state, tenderType) => {
    localSet('tenderType', tenderType);
    state.tenderType = tenderType;
  },
  set_deptList: (state, deptList) => {
    localSet('deptList', deptList);
    state.deptList = deptList;
  }
}

export default {
  state,
  mutations
}
